﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Abp.Auditing;
using GN.Pay.Application.GatewayApp;
using GN.Pay.Application.GatewayApp.Dto.Output;
using GN.Pay.GatewayWeb.Models;

namespace GN.Pay.GatewayWeb.Controllers.PayRoute
{
    /// <summary>
    /// 贵阳银行 Web
    /// </summary>
    [PayRoute(Channel_Id)]
    class GybWebPayActionRoute : APayActionRoute
    {
        public const string Channel_Id = "Gyb.WebPay";

        public GybWebPayActionRoute(IClientInfoProvider clientInfo, ITradeApplyAppService service)
            : base(clientInfo, service)
        {
        }

        public override string ChannelId
        {
            get
            {
                return Channel_Id;
            }
        }        

        protected override ActionResult ViewResult(PayChannelOutput output, Func<string, object, ActionResult> viewResultFactory)
        {
            var payModel = this.CreatePayPageModel(output.PayUrl, "post", output.PayParams);
            return viewResultFactory("PayPage", payModel);            
        }
    }
}